A typical computer system includes one or more storage devices, e.g., volatile memory, hard disk, removable media, etc. Such storage devices are typically used to store and/or access data for using and/or operating the computer system. For example, a storage device may contain user data, operating system data, file system data, application files, temporary files, cache data, etc.
To allow for storing of data, storage devices are typically separated into segments, or physical blocks, defining physical locations on the storage devices. For example, a 1024 KB removable media device may be separated into 256 blocks of 4 KB each. The aforementioned segmentation of a storage device may be based on a physical property of the storage device, e.g., the size of a sector on a disk or any other physical property of the storage device, or may simply be a logical segmentation, e.g., wherein segments include multiple disk sectors. There are many different schemes, based on physical and/or logical properties, for segmenting a storage device.
If more than one storage device is combined, for example in a stripe or mirror, then a volume manager is used to manage the relationship between the storage devices. More specifically, the volume manager creates a logical representation of the storage devices, whereby the storage devices appear as only a single storage device to a file system using the storage pool. Accordingly, the file system accesses the storage pool using logical offsets (i.e., addresses of physical blocks), which the volume manager translates to physical locations on specific storage devices. For example, if a storage pool includes two 500 MB disks, and the file system requests data from offset 501 MB, then the volume manager reads the data from offset 1 MB on the second disk.
Once a storage device is segmented into physical blocks, the file system (or a process associated therewith) must track which physical blocks are available for use. Accordingly, the file system maintains a block allocation map, indicating which of the physical blocks in the storage pool (i.e., physical blocks at each logical offset, as describe above) have been allocated, and which physical blocks are free to be allocated. When writing data to the storage pool, the selection of which physical block(s) to allocate is typically based on physical block availability, i.e., which blocks in the block allocation map are marked as free. Once the physical block(s) has been allocated, the block allocation map is updated to reflect that the physical block(s) is no longer free and the data is written to the physical block(s). Those skilled in the art will appreciate that in this arrangement, the file system is not aware of the specific physical layout of the storage pool, and the volume manager does not have access to the block allocation map.
The following is a brief explanation of how data may be stored in a storage pool. Initially, the file system receives a request to write the data to the storage pool. Upon receiving the request, the file system allocates a physical block (i.e., a physical block at a logical offset, as described above), using a block allocation map to identify a free physical block. Subsequently, the file system requests that the volume manager store the data at the determined logical offset. The volume manager translates the logical offset to a physical location on a specific storage device, and writes the data to that location.
When the targeted storage device is offline, data cannot be written to the storage device. If a first storage device fails while a second storage device remains online, then the devices are said to belong to separate “fault domains.” In other words, a failure of the first storage device does not necessarily imply a failure of the second storage device. Those skilled in the art will appreciate that because the file system only accesses a logical representation of the storage pool, provided by the volume manager, the file system does not have any awareness of the fault domains in the storage pool. Thus, if an attempt to write data fails, the file system cannot select an alternate location to store the data. Further, because the file system maintains the block allocation map, and because the file system requested that the data be written at a specific logical offset, the volume manager also cannot select an alternate location to store the data. Thus, the write fails.